layui.use(['layer',], function () {
    var layer = layui.layer;
    const url2 = 'https://fq.zhouxiumin.top/video.html?url=';
    var videos = document.getElementsByTagName("video");
    var videoUrls = [];
    for (var i = 0; i < videos.length; i++) {
        var video = videos[i];
        console.log(video);
        console.log(video.attributes);
        var src1 = video.getAttribute('src');
        console.log(src1);
        if (video.children.length>0) {
            console.log("video.childNodes:");
            console.log(video.children);
            src1 = encodeURIComponent(video.children[0].getAttribute('src'));
        }
        videoUrls.push(url2 + src1);
    }

    var content = "<ul class='layui-layer-wrap' style='display: block;padding: 20px'> ";
    for (var i = 0; i < videoUrls.length; i++) {
        content += "<li><a class='layui-btn layui-btn-lg' href='"+videoUrls[i]+"'><cite>视频"+(i + 1)+"</cite></a></li>"
    }
    content+=" </ul>";

    content += "<p> 视频数量： " + videos.length + "</p>";
    layer.open({
        type: 1,
        title: '视频',
        skin: 'layui-layer-lan',
        area: ['140px', '400px'],
        offset: 'r',
        shade: 0,
        content: content,
    });
});
